//
//  WebViewController.m
//  穷游项目
//
//  Created by 林程杰 on 15/1/2.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "WebViewController.h"

@implementation WebViewController

- (void)dealloc
{
    [_html release];
    [super dealloc];
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        
    }
    return self;
}

- (void) viewDidLoad
{
    [super viewDidLoad];
    
  

    
    
    self.navigationController.navigationBar.translucent = NO;
    
    UIWebView *web = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    [web setBackgroundColor:[UIColor whiteColor]];
    NSURL *url = [NSURL URLWithString:_html];
    NSURLRequest *requset = [NSURLRequest requestWithURL:url];
    [web loadRequest:requset];
    [self.view addSubview:web];
    
    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
    [button setImage:[UIImage imageNamed:@"close2.png"] forState:UIControlStateNormal];

    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
    
    [button addTarget:self action:@selector(backPage) forControlEvents:UIControlEventTouchUpInside];
    [web release];
    [button release];
}


- (void) backPage
{
    [self dismissViewControllerAnimated:YES completion:nil];
}




@end
